package com.examiner.dao;

import com.examiner.bean.test.NewTestJob;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface NewTestJobDao extends JpaSpecificationExecutor<NewTestJob>, JpaRepository<NewTestJob,Integer> {

    List<NewTestJob> findAllByNid(Integer id);

    @Query(value = "delete from new_test_job where nid=?1", nativeQuery = true)
    @Modifying(clearAutomatically = true)
    void deleteAllByNid(Integer id);
}
